package jihe_logon;

import java.util.ArrayList;

public  class List  implements Userdao {

  ArrayList<JI_user> userArrayList=new ArrayList<JI_user>();


    @Override
    public void zhuce(JI_user user) {
  userArrayList.add(user);
    }

    @Override
    public void zhuce(Userdao userdao) {

    }

    @Override
    public boolean login(String name, String pass) {
for(int i=0;i<userArrayList.size();i++)
{
    if(userArrayList.get(i).getName().equals(name)  &&
            userArrayList.get(i).getPass().equals(pass))
    {
return  true;
    }
}

        for(JI_user user:userArrayList)
        {
            System.out.println(user.getName()+":"+user.getPass());
        }

        return false;
    }


    public void show() {
        for(JI_user user:userArrayList)
        {
            System.out.println(user.getName()+":"+user.getPass());
        }
    }
}

